﻿using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.KDHttpUtility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Fibot.YGJD.K3Cloud.Service.PlugIn.SAL.DeliceryNotice
{
    public class Audit : AbstractOperationServicePlugIn
    {

        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            if (!this.OperationResult.IsSuccess)
            {
                return;
            }

            try
            {
                foreach (var item in e.DataEntitys)
                {
                    var billNo = item["BillNo"].ToString();
                    string url = $@"http://localhost:8200/WorkWeChat_WorkFlowAPI/api/K3Cloud/sal/DeliveryNoticePrint?billNo={billNo}";
                    HttpWebRequest client = (HttpWebRequest)WebRequest.Create(url); 
                    client.Method = "POST";
                    client.ContentType = "application/x-www-form-urlencoded";
                    client.GetResponse();
                }
            }
            catch (Exception ex)
            {
            }

        }

    }
}
